Optimal. Leaf size=223 \[ \frac{\sqrt{a+b x+c x^2} \left (-2 c h (8 a f h+9 b (e h+f g))+15 b^2 f h^2-2 c h x (5 b f h-6 c e h+2 c f g)-8 c^2 \left (f g^2-3 h (d h+e g)\right )\right )}{24 c^3 h}+\frac{\tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right ) \left (-8 c^2 (a e h+a f g+b d h+b e g)+6 b c (2 a f h+b e h+b f g)-5 b^3 f h+16 c^3 d g\right )}{16 c^{7/2}}+\frac{f (g+h x)^2 \sqrt{a+b x+c x^2}}{3 c h} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.303192, antiderivative size = 223, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.133, Rules used = {1653, 779, 621, 206} \[ \frac{\sqrt{a+b x+c x^2} \left (-2 c h (8 a f h+9 b (e h+f g))+15 b^2 f h^2-2 c h x (5 b f h-6 c e h+2 c f g)-8 c^2 \left (f g^2-3 h (d h+e g)\right )\right )}{24 c^3 h}+\frac{\tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right ) \left (-8 c^2 (a e h+a f g+b d h+b e g)+6 b c (2 a f h+b e h+b f g)-5 b^3 f h+16 c^3 d g\right )}{16 c^{7/2}}+\frac{f (g+h x)^2 \sqrt{a+b x+c x^2}}{3 c h} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1653
Rule 779
Rule 621
Rule 206
Rubi steps
\begin{align*} \int \frac{(g+h x) \left (d+e x+f x^2\right )}{\sqrt{a+b x+c x^2}} \, dx &=\frac{f (g+h x)^2 \sqrt{a+b x+c x^2}}{3 c h}+\frac{\int \frac{(g+h x) \left (-\frac{1}{2} h (b f g-6 c d h+4 a f h)-\frac{1}{2} h (2 c f g-6 c e h+5 b f h) x\right )}{\sqrt{a+b x+c x^2}} \, dx}{3 c h^2}\\ &=\frac{f (g+h x)^2 \sqrt{a+b x+c x^2}}{3 c h}+\frac{\left (15 b^2 f h^2-8 c^2 \left (f g^2-3 h (e g+d h)\right )-2 c h (8 a f h+9 b (f g+e h))-2 c h (2 c f g-6 c e h+5 b f h) x\right ) \sqrt{a+b x+c x^2}}{24 c^3 h}+\frac{\left (16 c^3 d g-5 b^3 f h-8 c^2 (b e g+a f g+b d h+a e h)+6 b c (b f g+b e h+2 a f h)\right ) \int \frac{1}{\sqrt{a+b x+c x^2}} \, dx}{16 c^3}\\ &=\frac{f (g+h x)^2 \sqrt{a+b x+c x^2}}{3 c h}+\frac{\left (15 b^2 f h^2-8 c^2 \left (f g^2-3 h (e g+d h)\right )-2 c h (8 a f h+9 b (f g+e h))-2 c h (2 c f g-6 c e h+5 b f h) x\right ) \sqrt{a+b x+c x^2}}{24 c^3 h}+\frac{\left (16 c^3 d g-5 b^3 f h-8 c^2 (b e g+a f g+b d h+a e h)+6 b c (b f g+b e h+2 a f h)\right ) \operatorname{Subst}\left (\int \frac{1}{4 c-x^2} \, dx,x,\frac{b+2 c x}{\sqrt{a+b x+c x^2}}\right )}{8 c^3}\\ &=\frac{f (g+h x)^2 \sqrt{a+b x+c x^2}}{3 c h}+\frac{\left (15 b^2 f h^2-8 c^2 \left (f g^2-3 h (e g+d h)\right )-2 c h (8 a f h+9 b (f g+e h))-2 c h (2 c f g-6 c e h+5 b f h) x\right ) \sqrt{a+b x+c x^2}}{24 c^3 h}+\frac{\left (16 c^3 d g-5 b^3 f h-8 c^2 (b e g+a f g+b d h+a e h)+6 b c (b f g+b e h+2 a f h)\right ) \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right )}{16 c^{7/2}}\\ \end{align*}
Mathematica [A] time = 0.255891, size = 215, normalized size = 0.96 \[ \frac{\frac{\sqrt{a+x (b+c x)} \left (-2 c h (8 a f h+b (9 e h+9 f g+5 f h x))+15 b^2 f h^2-4 c^2 (f g (2 g+h x)-3 h (2 d h+2 e g+e h x))\right )}{8 c^2}-\frac{3 h \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+x (b+c x)}}\right ) \left (8 c^2 (a e h+a f g+b d h+b e g)-6 b c (2 a f h+b e h+b f g)+5 b^3 f h-16 c^3 d g\right )}{16 c^{5/2}}+f (g+h x)^2 \sqrt{a+x (b+c x)}}{3 c h} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.056, size = 505, normalized size = 2.3 \begin{align*}{\frac{fh{x}^{2}}{3\,c}\sqrt{c{x}^{2}+bx+a}}-{\frac{5\,bfhx}{12\,{c}^{2}}\sqrt{c{x}^{2}+bx+a}}+{\frac{5\,hf{b}^{2}}{8\,{c}^{3}}\sqrt{c{x}^{2}+bx+a}}-{\frac{5\,{b}^{3}fh}{16}\ln \left ({ \left ({\frac{b}{2}}+cx \right ){\frac{1}{\sqrt{c}}}}+\sqrt{c{x}^{2}+bx+a} \right ){c}^{-{\frac{7}{2}}}}+{\frac{3\,abfh}{4}\ln \left ({ \left ({\frac{b}{2}}+cx \right ){\frac{1}{\sqrt{c}}}}+\sqrt{c{x}^{2}+bx+a} \right ){c}^{-{\frac{5}{2}}}}-{\frac{2\,afh}{3\,{c}^{2}}\sqrt{c{x}^{2}+bx+a}}+{\frac{ehx}{2\,c}\sqrt{c{x}^{2}+bx+a}}+{\frac{fgx}{2\,c}\sqrt{c{x}^{2}+bx+a}}-{\frac{3\,beh}{4\,{c}^{2}}\sqrt{c{x}^{2}+bx+a}}-{\frac{3\,bfg}{4\,{c}^{2}}\sqrt{c{x}^{2}+bx+a}}+{\frac{3\,{b}^{2}eh}{8}\ln \left ({ \left ({\frac{b}{2}}+cx \right ){\frac{1}{\sqrt{c}}}}+\sqrt{c{x}^{2}+bx+a} \right ){c}^{-{\frac{5}{2}}}}+{\frac{3\,{b}^{2}fg}{8}\ln \left ({ \left ({\frac{b}{2}}+cx \right ){\frac{1}{\sqrt{c}}}}+\sqrt{c{x}^{2}+bx+a} \right ){c}^{-{\frac{5}{2}}}}-{\frac{aeh}{2}\ln \left ({ \left ({\frac{b}{2}}+cx \right ){\frac{1}{\sqrt{c}}}}+\sqrt{c{x}^{2}+bx+a} \right ){c}^{-{\frac{3}{2}}}}-{\frac{afg}{2}\ln \left ({ \left ({\frac{b}{2}}+cx \right ){\frac{1}{\sqrt{c}}}}+\sqrt{c{x}^{2}+bx+a} \right ){c}^{-{\frac{3}{2}}}}+{\frac{dh}{c}\sqrt{c{x}^{2}+bx+a}}+{\frac{eg}{c}\sqrt{c{x}^{2}+bx+a}}-{\frac{bdh}{2}\ln \left ({ \left ({\frac{b}{2}}+cx \right ){\frac{1}{\sqrt{c}}}}+\sqrt{c{x}^{2}+bx+a} \right ){c}^{-{\frac{3}{2}}}}-{\frac{beg}{2}\ln \left ({ \left ({\frac{b}{2}}+cx \right ){\frac{1}{\sqrt{c}}}}+\sqrt{c{x}^{2}+bx+a} \right ){c}^{-{\frac{3}{2}}}}+{dg\ln \left ({ \left ({\frac{b}{2}}+cx \right ){\frac{1}{\sqrt{c}}}}+\sqrt{c{x}^{2}+bx+a} \right ){\frac{1}{\sqrt{c}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.4843, size = 1060, normalized size = 4.75 \begin{align*} \left [\frac{3 \,{\left (2 \,{\left (8 \, c^{3} d - 4 \, b c^{2} e +{\left (3 \, b^{2} c - 4 \, a c^{2}\right )} f\right )} g -{\left (8 \, b c^{2} d - 2 \,{\left (3 \, b^{2} c - 4 \, a c^{2}\right )} e +{\left (5 \, b^{3} - 12 \, a b c\right )} f\right )} h\right )} \sqrt{c} \log \left (-8 \, c^{2} x^{2} - 8 \, b c x - b^{2} - 4 \, \sqrt{c x^{2} + b x + a}{\left (2 \, c x + b\right )} \sqrt{c} - 4 \, a c\right ) + 4 \,{\left (8 \, c^{3} f h x^{2} + 6 \,{\left (4 \, c^{3} e - 3 \, b c^{2} f\right )} g +{\left (24 \, c^{3} d - 18 \, b c^{2} e +{\left (15 \, b^{2} c - 16 \, a c^{2}\right )} f\right )} h + 2 \,{\left (6 \, c^{3} f g +{\left (6 \, c^{3} e - 5 \, b c^{2} f\right )} h\right )} x\right )} \sqrt{c x^{2} + b x + a}}{96 \, c^{4}}, -\frac{3 \,{\left (2 \,{\left (8 \, c^{3} d - 4 \, b c^{2} e +{\left (3 \, b^{2} c - 4 \, a c^{2}\right )} f\right )} g -{\left (8 \, b c^{2} d - 2 \,{\left (3 \, b^{2} c - 4 \, a c^{2}\right )} e +{\left (5 \, b^{3} - 12 \, a b c\right )} f\right )} h\right )} \sqrt{-c} \arctan \left (\frac{\sqrt{c x^{2} + b x + a}{\left (2 \, c x + b\right )} \sqrt{-c}}{2 \,{\left (c^{2} x^{2} + b c x + a c\right )}}\right ) - 2 \,{\left (8 \, c^{3} f h x^{2} + 6 \,{\left (4 \, c^{3} e - 3 \, b c^{2} f\right )} g +{\left (24 \, c^{3} d - 18 \, b c^{2} e +{\left (15 \, b^{2} c - 16 \, a c^{2}\right )} f\right )} h + 2 \,{\left (6 \, c^{3} f g +{\left (6 \, c^{3} e - 5 \, b c^{2} f\right )} h\right )} x\right )} \sqrt{c x^{2} + b x + a}}{48 \, c^{4}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (g + h x\right ) \left (d + e x + f x^{2}\right )}{\sqrt{a + b x + c x^{2}}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.22228, size = 284, normalized size = 1.27 \begin{align*} \frac{1}{24} \, \sqrt{c x^{2} + b x + a}{\left (2 \,{\left (\frac{4 \, f h x}{c} + \frac{6 \, c^{2} f g - 5 \, b c f h + 6 \, c^{2} h e}{c^{3}}\right )} x - \frac{18 \, b c f g - 24 \, c^{2} d h - 15 \, b^{2} f h + 16 \, a c f h - 24 \, c^{2} g e + 18 \, b c h e}{c^{3}}\right )} - \frac{{\left (16 \, c^{3} d g + 6 \, b^{2} c f g - 8 \, a c^{2} f g - 8 \, b c^{2} d h - 5 \, b^{3} f h + 12 \, a b c f h - 8 \, b c^{2} g e + 6 \, b^{2} c h e - 8 \, a c^{2} h e\right )} \log \left ({\left | -2 \,{\left (\sqrt{c} x - \sqrt{c x^{2} + b x + a}\right )} \sqrt{c} - b \right |}\right )}{16 \, c^{\frac{7}{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]